home *** CD-ROM | disk | FTP | other *** search
- ===========================================================================
- BBS: The Abacus * HST/DS * Potterville MI
- Date: 05-09-93 (17:09) Number: 104
- From: JAMES WHATLEY Refer#: NONE
- To: ALL Recvd: NO
- Subj: Structures Conf: (36) C Language
- ---------------------------------------------------------------------------
- Hi ya'll,
-
- I'm back with questions about structures and passing information
- into.
-
- Here's how the structure looks:
-
- struct cattribs{
- int strength;
- int dexterity;
- int wisdom;
- int intelligence;
- int charisma;
- int constitution;
- int hitpoints;
- char charname[80];
- char playername[80];
- char charrace[40];
- char charclass[40];
- char status[40];
- char charalign[20];
- }player;
-
- and here's the information I'm trying to pass to it:
- int align(void)
- {
- char choice;
- printf("\nNow you need to choose your characters alignment.\n");
- printf("Choices are:\n");
- printf("LG = Lawful Good LE = Lawful Evil\n");
- printf("NG = Neutral Good NE = Neutral Evil\n");
- printf("CG = Chaotic Good CE = Chaotic Evil\n");
- printf(" TN = True Neural");
- printf("\n\nEnter the two character code of your choice: ");
- scanf("%s", &choice);
-
- if(choice == "LG" || choice == "lg" || choice == "Lg" || choice == "lG")
- player.charalign = "Lawful Good";
- else if(choice == "LE" || choice == "le" || choice == "Le" || choice == "lE")
- player.charalign = "Lawful Evil";
- else if(choice == "NG" || choice == "ng" || choice == "Ng" || choice == "nG")
- player.charalign = "Neutral Good";
- else if(choice == "NE" || choice == "ne" || choice == "Ne" || choice == "nE")
- player.charalign = "Neutral Evil";
- else if(choice == "CG" || choice == "cg" || choice == "Cg" || choice == "cG")
- player.charalign = "Chaotic Good";
- else if(choice == "CE" || choice == "ce" || choice == "Ce" || choice == "cE")
- player.charalign = "Chaotic Evil";
- else if(choice == "TN" || choice == "tn" || choice == "Tn" || choice == "tN")
- player.charalign = "True Neutral";
-
- return(0);
- }
-
- Now for the problem..How do I pass to player.charalign the string
- that I want in there? I've tried using == and still no good. I'm
- attempting to compile this under OS/2 2.0 using GNU's gcc compiler.
- Any help (preference is hints) in pointing towards the right
- direction would be greatly appreciated.
-
- Jim
-
-
- ... Just cannot resist a little fun along the way. :-)
- --- GEcho 1.00
- * Origin: The Watering Hole BBS Tokyo +81-3-3657-9255 (6:730/18.0)
- SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
- SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
- SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20
-